package com.xu.demo.events;

import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class MyEventListener {

    @EventListener
    @Async
    public void handleEventA(EventA eventA) {
        System.out.println("正在处理 " + eventA.getEventName());
    }

    @EventListener
    @Async
    public void handleEventB(EventB eventB) {
        System.out.println("正在处理 " + eventB.getEventName());
    }

}
